#include <stdio.h>
#include <stdint.h>
#include "thread"
#include <iostream>
#include <cstring>
#include "ut/ut_test.h"
#include <vector>



void TestFunc()
{
    printf("start to TestFunc\n");
    std::vector<char> v1;
    v1.resize(999);

    std::vector<char> v2;
    v2.resize(1024*1024);

    //printf("v1 %ld %ld; v2:%ld %ld\n", v1.size(), v1.capacity(), v2.size(), v2.capacity());

    return;    
}

void TestFunc2()
{
    printf("start to TestFunc2\n");

    return; 
}


int32_t main()
{
    printf("hello world\n");

    TestFunc();

    do {
        printf("input q or Q to exit:\n");
        printf("\t a: test:\n");
        printf("\t b: TestEventLoopThreadStart:\n");
        printf("\t c: TestEventLoopThreadStop:\n");
        printf("\t d: TestEventLoopThreadFunc:\n");
        printf("\t g: TestTcpClinetStart:\n");
        printf("\t h: TestTcpClinetStop:\n");
        printf("\t i: TestTcpClinetSend:\n");
        printf("\t j: TestBuffer:\n");


        std::string input;
        std::cin >> input;

        if ("q" == input || "Q" == input) {
            break;
        } else if ("a" == input) {
            TestFunc2();
        } else if ("b" == input) {
            TestEventLoopThreadStart();
        } else if ("c" == input) {
            TestEventLoopThreadStop();
        } else if ("d" == input) {
            TestEventLoopThreadFunc();
        } else if ("g" == input) {
            TestTcpClinetStart();
        } else if ("h" == input) {
            TestTcpClinetStop();
        } else if ("i" == input) {
            TestTcpClinetSend();
        } else if ("j" == input) {
            TestBuffer();
        } 
        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    } while (1);

    return 0;
}
